import { DataResult, InfoResult } from "@/type";
import { $get, $post } from "./index";

/**
 * @function 查询库位
 * 
 * @param {string} companyNo   起运地编号
 * @param {boolean} send     发货   
 */

interface Warehouse {
    companyNo: string
    send: boolean
}
export const getWarehouse = (data: Warehouse): Promise<Taro.request.SuccessCallbackResult<DataResult<any>>> => {
    return $get<Warehouse>(`/selfmachine-system/order/warehouse?companyNo=${data.companyNo}&send=${data.send}`).then(res =>{
          if (res.data.code == '200') {

            return res.data.data
          }else {
            return []
          }
    });
};
